package kr.hkit.powerjava.chapter22;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Search {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		System.out.println("탐색할 값을 입력.");
		int key = sc.nextInt();
//		int key = 50;
		List<Integer> list = new ArrayList<Integer>();
		for(int i=0; i<100; i++){
			list.add(i);
		}
		int index = Collections.binarySearch(list, key);
		System.out.println("탐색의 반한값 = "+ index);
	}
}
